package org.maven.ear.jobss.mdc.spring.web.web;

import java.util.logging.Level;
import java.util.logging.Logger;

import org.maven.ear.jobss.mdc.spring.web.domain.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
@RequestMapping("create")
public class CreateController {
	private static Logger Log = Logger.getLogger(CreateController.class
			.getName());

	@RequestMapping(method = RequestMethod.GET)
	void getInitialMessage() {

		Log.log(Level.ALL, "dss");
	}

	@RequestMapping(method = RequestMethod.POST)
	public String create(User user) {
		try {
			Log.log(Level.ALL, "dss");
			return "greet";
		} catch (Exception e) {
			return "An error has occured while creating the user (see log for details)";
		}
	}
}
